/*
 * Created on 2005-4-6
 *
 */
package com.hd123.rumba.util;

import java.util.Date;

/**
 * @author caili
 */
public class StopWatch {
  private Date startTime;
  private Date stopTime;
  
  public StopWatch() {
    super();
  }
  public StopWatch start() {
    startTime = new Date();
    return this;
  }
  public long stop() {
    stopTime = new Date();
    return getTime();
  }
  public long getTime() {
    return stopTime.getTime() - startTime.getTime();
  }
  public void resume() {
    // do nothing
  }
  
  public Date getStartTime() {
    return startTime;
  }
  public void setStartTime(Date startTime) {
    this.startTime = startTime;
  }
  public Date getStopTime() {
    return stopTime;
  }
  public void setStopTime(Date stopTime) {
    this.stopTime = stopTime;
  }
 
}
